import request from '@/utils/request'
// -------------智慧贷款------------

let BASE_ADDRESS = '/tool/loanUser'

// 姓名+公司名，查出多个公司，让用户选择  /tool/loanUser/findCompany
export const getLoanUserFindCompanyApi = (params) =>{
    return request({
        url:`${BASE_ADDRESS}/findCompany`,
        method:'get',
        params
    })
}

// 添加一个智慧贷款信息 /tool/loanUser/add
export const addLoanUserApi = (data) =>{
    return request({
        url:`${BASE_ADDRESS}/add`,
        method:'post',
        data
    })
}

// 获取贷款需求 /tool/loanNeeds/list
export const getLoanNeedsListApi = () =>{
    return request({
        url:`/tool/loanNeeds/list`,
        method:'get',
    })
}

//修改贷款用户的信息 /tool/loanUser/edit
export const editLoanUserApi = (data) =>{
    return request({
        url:`${BASE_ADDRESS}/edit`,
        method:'put',
        data
    })
}

// 获取资格列表 /tool/loanCondition/list
export const getLoanConditionListApi = (type) =>{
    return request({
        url:`/tool/loanCondition/list?type=${type}`,
        method:'get',
    })
}

// 修改用户符合的条件 /tool/loanUser/editCondition
export const editLoanUserConditionApi = (params) =>{
    return request({
        url:`${BASE_ADDRESS}/editCondition`,
        method:'put',
        params
    })
}

// 获取押品信息的列表 /tool/collateralType/list
export const getCollateralTypeListApi = () =>{
    return request({
        url:`/tool/collateralType/list`,
        method:'get',
    })
}

// 查询当前用户历史押品信息的接口 /tool/collateral/findMaxCollateral
export const getCollateralFindMaxCollateralApi = (params) =>{
    return request({
        url:`/tool/collateral/findMaxCollateral`,
        method:'get',
        params
    })
}

// 添加贷款押品的接口 /tool/collateral/add
export const addToolCollateralApi = (data) =>{
    return request({
        url:`/tool/collateral/add`,
        method:'post',
        data
    })
}

// 添加多个贷款押品的接口 /tool/collateral/addlist
export const addListToolCollateralApi = (data) =>{
    return request({
        url:`/tool/collateral/addlist`,
        method:'post',
        data
    })
}

// 运算的接口 /tool/loanUser/findLoan
export const loanUserFindLoanApi = (params) =>{
    return request({
        url:`/tool/loanUser/findLoan`,
        method:'get',
        params
    })
}

// 查询历史运算结果 /tool/loanUser/list
export const getLoanUserListApi = (create_by) =>{
    return request({
        url:`/tool/loanUser/list?create_by=${create_by}`,
        method:'get',
    })
}